package com.lcj.bff.driver.service.impl;

import com.lcj.bff.driver.controller.form.DriverIdForm;
import com.lcj.bff.driver.feign.SnmServiceApi;
import com.lcj.bff.driver.service.OrderMessageService;
import com.lcj.common.util.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

@Service
public class OrderMessageServiceImpl implements OrderMessageService {

    @Resource
    private SnmServiceApi snmServiceApi;
    
    @Override
    public void clearNewOrderQueue(DriverIdForm form) {
        snmServiceApi.clearNewOrderQueue(form);
    }

    @Override
    public ArrayList receiveNewOrderMessage(DriverIdForm form) {
        Result r = snmServiceApi.receiveNewOrderMessage(form);
        ArrayList list = (ArrayList) r.get("result");
        return list;
    }

}